<?php
/**
 * MySQL model
 * 
 * @author RiderSx
 */
class discussions_Model extends GlobalModel {
	public function getAllDiscussions () {
		$discussions = array();
		$sql = "SELECT * FROM `xine_discussions` ORDER BY `start_time` DESC";
		$res = mysql_query($sql);
		
		if(mysql_num_rows($res) >= 1) {
			while($result=mysql_fetch_assoc($res)) {
				$discussions[] = $result;
			}
		} else {
			$discussions = false;
		}
		
		return $discussions;
	}
}